package com.wwdeng.smart.base

import android.content.Context
import android.os.Bundle
import android.view.View
import androidx.fragment.app.FragmentActivity
import com.wwdeng.smart.utils.TitleBarUtil

/**
 * android
 * @Author：wwdeng
 * @CreateTime：2024/9/15 16:16
 * <pre>
 * Activity 基类
 * </pre>
 */
abstract class BaseAct: FragmentActivity(),IBaseView {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        TitleBarUtil.transparentStatusBar(this)
        TitleBarUtil.setStatusBarLightMode(this, true)
        if (getRootView() != null){
            setContentView(getRootView())
        }

        initView()
        initListener()
        initData()
    }

    override fun getContext(): Context? {
        return this
    }

    abstract fun getRootView(): View?

    abstract fun initView()

    abstract fun initListener()

    abstract fun initData()

}